package com.alennus.blog.rabbitMq.spring_rabbit.product_object_customer;

import com.alennus.blog.rabbitMq.spring_rabbit.config.RabbitConfig;
import com.alennus.blog.rabbitMq.spring_rabbit.domain.User;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * Created by pactera on 2018/9/25.
 */
@Component
public class ProductObjectSend {


    @Autowired
    public RabbitTemplate rabbitTemplate;


    public void send(User user){
        rabbitTemplate.convertAndSend(RabbitConfig.QUEUE_SIMPLE_USER_NAME,user);
    }
}
